<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends SCAction {
    public function index(){
	$d=M('index');
	$this->links=$d->order('ordi')->select();
	$d=M('products');
	$this->pro=$d->order('datetime')->limit(10)->select();
	$this->display();
    }
	public function show($id=-1,$title=''){
	$d=M('index');
	$this->links=$d->order('ordi')->select();
	$d=M('info');
	if($id>=0){
	$info=$d->find($id);
	}else
	{
	$where['title']=$title;
	$info=$d->where($where)->find();
	$where=NULL;
	}
	$where['pid']=$info['pid'];
	$list=$d->where($where)->field('id,title')->select();
	$where=NULL;
	$d=M('info_index');
	$where['id']=$info['pid'];
	$class=$d->where($where)->field('title')->find();
	$where=NULL;
	//dump($class);
	//dump($list);
	//dump($info);
	$this->class=$class;
	$this->list=$list;
	$this->info=$info;
	$this->display();
	}
}
?>